package skeleton;


public class Switch extends DigitalElement implements IInteractiveObject {

    public Switch () {
        Logger.Message("Switch_konstruktor");
    }

    @Override
    public void stepState() throws Exception{
        Logger.Message("Switch_stepState");

        //wirek updatelese
        int answer = Prompter.Switch( new String[] {
            "OFF",
            "ON"
        });
        switch (answer) {
                case 0:
                    for(int i=0; i<outputList.size(); i++)
                        outputList.get(i).setDigitalValue(Sign.Low);
                    break;
                case 1:
                    for(int i=0; i<outputList.size(); i++)
                        outputList.get(i).setDigitalValue(Sign.High);
                    break;
        }
        NetworkController.getInstance().Update();
    }

}

